﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Prototipo.CMS.Models;

namespace Prototipo.CMS.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            dynamic product = new Product();

            product.get_by_id(1);

            ViewBag.Title = "Teste";

            return View(Post.GetAll(Server.MapPath("~/App_Data/Posts.xml")).Reverse());
        }

        protected override void OnActionExecuting(ActionExecutingContext filterContext)
        {
            ViewBag.Configuration = new Configuration(Server.MapPath("~/"));

            base.OnActionExecuting(filterContext);
        }
    }
}
